﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Awesomium.Core;
using FazaDemo.PL.EventFactories;

namespace FazaDemo.PL.Wpf
{
    public class WebControlHandler
    {

        private readonly ConcreteWebEvent _webEvent;

        public WebControlHandler(ConcreteWebEvent webEvent)
        {
            _webEvent = webEvent;
        }

        public void Execute()
        {
            var urlEventArgs = _webEvent.EventArgs as UrlEventArgs;
            if (urlEventArgs != null)
            {
                _webEvent.Control.LoadHTML(_webEvent.Control.HTML);
            }
        }

    }
}
